// xuqiu/xuqiuCom/shuaixuan/shuaixuan.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    
  },

  /**
   * 组件的初始数据
   */
  data: {
   tap:false,
   font:'#626262',
   selected:'one'
  },

  /**
   * 组件的方法列表
   */
  methods: {
    which:function(e)
    {
      var id=e.target.id;
      var tap=this.data.tap;
       console.log(id)
      if(id=='one'||id=='two')
      this.setData({
        selected:id
      })
      
      this.triggerEvent('which',{id,tap})
    },
    selected:function(e)
    {
      wx.pageScrollTo({
        scrollTop: 0,
      })
      console.log('select')
      // tap?false:true
      // font == '#626262' ? '#02a0e9' : '#626262'
      this.data.tap && this.data.font == '#02a0e9' ?this.setData({
        tap: false,
        font: '#626262'
      }):this.setData({
        tap: true,
        font: '#02a0e9' 
      }) 
    }
  }
})
